package com.hyts.mvc.configure;

import com.hyts.mvc.register.FilterRegistationWrapper;
import com.hyts.mvc.register.ListenerRegistationWrapper;
import com.hyts.mvc.register.ServletRegistationWrapper;
import lombok.Getter;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.mvc.configure
 * author:Libo/Alex
 * create-date:2019-07-02 22:22
 * email:liboware@gmail.com
 * description:此类主要用于:
 */
public abstract class WebMvcConfigurerAdapter extends WebMvcConfigurer {

    /**
     * webmvc服务注册器
     */

    WebMvcConfigurerRegistry webMvcConfigurerRegistry;

    protected abstract void addWebServlet(WebMvcConfigurerRegistry webMvcConfigurerRegistry);

    protected abstract void addWebFilter(WebMvcConfigurerRegistry webMvcConfigurerRegistry);

    protected abstract void addWebListener(WebMvcConfigurerRegistry webMvcConfigurerRegistry);


    public void build(WebMvcConfigurerRegistry webMvcConfigurerRegistry){
        this.webMvcConfigurerRegistry = webMvcConfigurerRegistry;
    }

    @Override
    public void addWebServlet() {
        addWebServlet(webMvcConfigurerRegistry);
    }

    @Override
    public void addWebFilter() {
        addWebFilter(webMvcConfigurerRegistry);
    }

    @Override
    public void addWebListener() {
        addWebListener(webMvcConfigurerRegistry);
    }

    @Override
    public int value() {
        return 2;
    }

}
